package main //必须有一个main包

import "fmt"

func main() {

	str := "abc"
	fmt.Println("==== normal ======")
	for i := 0; i < len(str); i++ {
		fmt.Printf(" \t str[%d] = %c \n ", i, str[i])
	}

	fmt.Println("==== range ======")
	for i, data := range str {
		fmt.Printf(" \t str[%d] = %c \n ", i, data)
	}

	fmt.Println("&&& range  &&&")
	for i := range str {
		fmt.Printf(" \t str[%d] = %c \n ", i, str[i])
	}

	fmt.Println(" %%%% range_niming  %%% ")
	for i, _ := range str {
		fmt.Printf(" \t str[%d] = %c \n ", i, str[i])
	}

}
